home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / ToolUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  3.6 KB  |  173 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Contains:    Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __TOOLUTILS__
  19. #define __TOOLUTILS__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #if OLDROUTINELOCATIONS
  29. #ifndef __FIXMATH__
  30. #include <FixMath.h>
  31. #endif
  32. #ifndef __ICONS__
  33. #include <Icons.h>
  34. #endif
  35. #ifndef __QUICKDRAW__
  36. #include <Quickdraw.h>
  37. #endif
  38. #ifndef __TEXTUTILS__
  39. #include <TextUtils.h>
  40. #endif
  41. #endif  /* OLDROUTINELOCATIONS */
  42.  
  43.  
  44.  
  45. #if PRAGMA_ONCE
  46. #pragma once
  47. #endif
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_IMPORT
  54. #pragma import on
  55. #endif
  56.  
  57. #if PRAGMA_STRUCT_ALIGN
  58.     #pragma options align=mac68k
  59. #elif PRAGMA_STRUCT_PACKPUSH
  60.     #pragma pack(push, 2)
  61. #elif PRAGMA_STRUCT_PACK
  62.     #pragma pack(2)
  63. #endif
  64.  
  65.  
  66. /*
  67. ————————————————————————————————————————————————————————————————————————————————————
  68.     Note: 
  69.     
  70.     The following routines that used to be in this header file, have moved to
  71.     more appropriate headers.  If OLDROUTINELOCATIONS is 0, then you will have
  72.     to include the headers below to use the following functions.
  73.     
  74.         FixMath.h:        FixMul
  75.                         FixRatio
  76.                         FixRound
  77.         
  78.         Icons.h:          GetIcon
  79.                         PlotIcon
  80.                         
  81.         Quickdraw.h:    AngleFromSlope
  82.                         DeltaPoint
  83.                         GetCursor
  84.                         GetIndPattern
  85.                         GetPattern
  86.                         GetPicture
  87.                         PackBits
  88.                         ScreenRes
  89.                         ShieldCursor
  90.                         SlopeFromAngle
  91.                         UnpackBits
  92.                         
  93.         TextUtils.h:    Munger
  94.                         GetIndString
  95.                         GetString
  96.                         NewString
  97.                         SetString
  98. ————————————————————————————————————————————————————————————————————————————————————
  99. */
  100.  
  101.  
  102. EXTERN_API( Boolean )
  103. BitTst                            (const void *            bytePtr,
  104.                                  long                     bitNum)                                ONEWORDINLINE(0xA85D);
  105.  
  106. EXTERN_API( void )
  107. BitSet                            (void *                    bytePtr,
  108.                                  long                     bitNum)                                ONEWORDINLINE(0xA85E);
  109.  
  110. EXTERN_API( void )
  111. BitClr                            (void *                    bytePtr,
  112.                                  long                     bitNum)                                ONEWORDINLINE(0xA85F);
  113.  
  114. EXTERN_API( long )
  115. BitAnd                            (long                     value1,
  116.                                  long                     value2)                                ONEWORDINLINE(0xA858);
  117.  
  118. EXTERN_API( long )
  119. BitOr                            (long                     value1,
  120.                                  long                     value2)                                ONEWORDINLINE(0xA85B);
  121.  
  122. EXTERN_API( long )
  123. BitXor                            (long                     value1,
  124.                                  long                     value2)                                ONEWORDINLINE(0xA859);
  125.  
  126. EXTERN_API( long )
  127. BitNot                            (long                     value)                                ONEWORDINLINE(0xA85A);
  128.  
  129. EXTERN_API( long )
  130. BitShift                        (long                     value,
  131.                                  short                     count)                                ONEWORDINLINE(0xA85C);
  132.  
  133. #if TARGET_CPU_68K
  134.  
  135. struct Int64Bit {
  136.     SInt32                             hiLong;
  137.     UInt32                             loLong;
  138. };
  139. typedef struct Int64Bit                    Int64Bit;
  140. EXTERN_API( void )
  141. LongMul                            (long                     a,
  142.                                  long                     b,
  143.                                  Int64Bit *                result)                                ONEWORDINLINE(0xA867);
  144.  
  145. #else
  146.     #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  147. #endif  /* TARGET_CPU_68K */
  148.  
  149. #define HiWord(x) ((short)((long)(x) >> 16))
  150. #define LoWord(x) ((short)(x))
  151.  
  152.  
  153. #if PRAGMA_STRUCT_ALIGN
  154.     #pragma options align=reset
  155. #elif PRAGMA_STRUCT_PACKPUSH
  156.     #pragma pack(pop)
  157. #elif PRAGMA_STRUCT_PACK
  158.     #pragma pack()
  159. #endif
  160.  
  161. #ifdef PRAGMA_IMPORT_OFF
  162. #pragma import off
  163. #elif PRAGMA_IMPORT
  164. #pragma import reset
  165. #endif
  166.  
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170.  
  171. #endif /* __TOOLUTILS__ */
  172.  
  173.